package com.karina.visualization.chart.client;

import java.util.List;

import com.karina.visualization.chart.component.BucketSeries;
import com.karina.visualization.chart.component.CapacityChartWidget;
import com.karina.visualization.chart.component.ChartBase;
import com.karina.visualization.chart.model.CapacityModel;
import com.karina.visualization.chart.model.SeriesModel;
import com.karina.visualization.chart.skins.ChartPaneSkinImpl;

public class BucketChartWidget extends CapacityChartWidget {

	static class BucketChart extends ChartBase<CapacityModel, List<String>> {

		protected BucketChart() {
			super(null, new ChartPaneSkinImpl());

		}

		@Override
		public String getSelectorName() {
			return "BucketChart";
		}

		@SuppressWarnings({ "rawtypes", "unchecked" })
		@Override
		protected Series createSeries(SeriesModel model) {
			return new BucketSeries(model);
		}
	}

	public BucketChartWidget() {
		super(new BucketChart());
		setChartStyle("BucketChart.BucketSeries", "width", 100);
		setChartStyle("BucketChart.BucketSeries", "height", 200);
	}
}
